
<script setup lang="ts">
import ArrowVue from '@/components/icon/Arrow.vue';
interface Props {
  item: Record<string, any>,
  // show: boolean
}
withDefaults(defineProps<Props>(), {
  item: () => ({}),
  // show: true
})
</script>
<template>
  <router-link class="list-item" :to="'/news/article?id=' + item.id">
    <div class="info flex-1 flex-min">
      <div class="title line-1 font-md">{{ item.title }}</div>
      <div class="desc-wrap font-sm">
        <div class="desc text-muted line-2">{{ item.introduce }}</div>
      </div>
    </div>
    <div class="tips flex-shrink">
      <div class="date-wrap text-main">
        <span class="year font-sm">{{ item.year }}</span>
        <span class="md font-m">{{ item.create_at }}</span>
      </div>
      <div class="read">
        <div class="arrow arrow-1">
          <ArrowVue color="#9195A3"></ArrowVue>
        </div>
        <div class="arrow arrow-2">
          <ArrowVue color="#9195A3"></ArrowVue>
        </div>
      </div>
    </div>
  </router-link>
</template>
<style lang="scss" scoped>
.list-item {
  height: 93px;
  padding-left: 25px;
  display: flex;
  cursor: pointer;

  &:not(:last-child) {
    margin-bottom: 20px;
    border-bottom: 1px solid #C6C6C6;
  }

  .info {
    position: relative;
    transition: all .36s ease;

    &::before {
      content: '';
      position: absolute;
      top: 13px;
      left: -20px;
      width: 5px;
      height: 5px;
      background: #9195A3;
      border-radius: 50%;
      // transform: translateY(-50%);
    }
  }

  .title {
    position: relative;
    height: 30px;
    line-height: 30px;
    color: #000;
  }

  .tips {
    width: 100px;
    margin-left: 100px;
  }

  .year {
    display: none;
  }

  .desc-wrap {
    padding-top: 10px;
    padding-bottom: 20px;
  }

  .date-wrap {
    line-height: 30px;
  }

  .read {
    overflow: hidden;
    position: relative;
    width: 40px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    color: #9195A3;
    border-left: 1px solid #9195A3;

    .arrow {
      position: absolute;
      top: 50%;
      transform: translate(-50%, -50%);
      transition: all .36s ease;
    }

    .arrow-1 {
      left: 50%;
      color: #9195A3;
    }

    .arrow-2 {
      left: -50%;
      color: #9195A3;
    }
  }

  &:hover {
    .title {
      background-image: linear-gradient(to right, #252086 0%, #E60012 100%);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }

    .info {
      transform: translateX(20px);
    }

    .arrow-1 {
      left: 150%;
      color: #9195A3;
    }

    .arrow-2 {
      left: 50%;
      color: #9195A3;
    }
  }
}
</style>